package com.three.crm.adapter;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.three.crm.R;
import com.three.crm.bean.VisitBean;

import java.util.List;

public class VisitListAdapter extends BaseQuickAdapter<VisitBean, BaseViewHolder> {

    public VisitListAdapter(@Nullable List<VisitBean> data) {
        super(R.layout.item_list_visit,data);
    }

    public VisitListAdapter() {
        super(R.layout.item_list_visit);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, VisitBean item) {
        helper.setText(R.id.tv_company,item.getTitle())
                .setText(R.id.tv_name, item.getAddress())
                .setText(R.id.tv_phone, "" + item.getPhone())
                .setText(R.id.tv_time, "" + item.getCtime())
                .setText(R.id.tv_times, "" + item.getVisit_times())
                .addOnClickListener(R.id.tv_detail,R.id.tv_edit);
    }
}
